<template lang="html">
  <div class="artists">
      <ul class="list">
        <backtop/>
        <router-link tag="li" :to="{name: 'SingerDetail',params:{ singerId: item.id,singerName: item.name,singerPic: item.picUrl}}" class="artist" v-for="(item,index) in artistsArr" :key="index" >
          <div class="pic">
            <img :alt="item.name" :src="item.picUrl">
          </div>
          <div class="info">
            <div>{{ item.name }}</div>
          </div>
        </router-link>
      </ul>
    </div>
</template>

<script>
export default {
  name:"artists",
  data(){
    return{
       artistsArr:[],
    }
  },
  mounted(){
    const artistsURL = this.HOST + `/artist/list?type=-1&area=7&limit=30`;
      this.$axios.get(artistsURL).then(res => {
        this.artistsArr = res.data.artists;
        })
        .catch(err => console.log('获取歌手信息报错', err.response.data.message))
  }
}
</script>

<style scoped>

.artists{
  padding: 0 17px;
  background: #fff;
}

.list li {
    padding-left: 0;
    min-height: 70px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #F2F2F2;
}

.list .artist:hover {
  color: #30CABB;
}

.pic{
  width: 54px;
  height: 54px;
  margin-right: 15px;
}

.info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    font-size: 16px;
}

.pic img{
  border-radius: 27px;
  overflow: hidden;
}


</style>
